This script does not display anything. Can someone please let me know why? Regards Jester
//Object ob = current
string Text=""
Buffer bufCur = create()
bufCur = text(column 1, obj) "" // Text retrieved from column 2
Buffer bufOld = create()
bufOld= text(column 2, obj) "" // Text retrieved from column 2
if (bufCur!=bufOld)
{
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
Text = Text stringOf(bufDiff) " \n"
delete(bufDiff)
}
delete(bufOld)
delete(bufCur)
jester76 - Mon Aug 27 18:55:23 EDT 2012 |
|
Re: Dynamic Column compare kbmurphy - Mon Aug 27 19:50:09 EDT 2012
You said:
>
> This script does not display anything. Can someone please let me know why? Regards Jester
The script doesn't have a line instructing it to display anything. (I assume this is layout DXL)
|
|
Re: Dynamic Column compare jester76 - Tue Aug 28 10:17:28 EDT 2012 kbmurphy - Mon Aug 27 19:50:09 EDT 2012
You said:
>
> This script does not display anything. Can someone please let me know why? Regards Jester
The script doesn't have a line instructing it to display anything. (I assume this is layout DXL)
Sorry Here is the full script. And yes this is a layout DXL.
//Object ob = current
string Text=""
Buffer bufCur = create()
bufCur = text(column 1, obj) ""
Buffer bufOld = create()
bufOld= text(column 2, obj) ""
if (bufCur!=bufOld)
{
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
Text = Text stringOf(bufDiff) " \n"
}
delete(bufOld)
delete(bufCur)
displayRich ("Text does not match")
delete(bufDiff)
|
|
Re: Dynamic Column compare Peter_Albert - Tue Aug 28 10:50:34 EDT 2012 jester76 - Tue Aug 28 10:17:28 EDT 2012
Sorry Here is the full script. And yes this is a layout DXL.
//Object ob = current
string Text=""
Buffer bufCur = create()
bufCur = text(column 1, obj) ""
Buffer bufOld = create()
bufOld= text(column 2, obj) ""
if (bufCur!=bufOld)
{
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
Text = Text stringOf(bufDiff) " \n"
}
delete(bufOld)
delete(bufCur)
displayRich ("Text does not match")
delete(bufDiff)
I guess that either "column 1" or "column 2" is layout DXL? There is a bug in the "text(Column, Object)" perm that, when used in layout DXL itself, causes DXL to stop if the Column in question in turn contains layout DXL. Put a 'display "x"' before the if clause, and you will see that you never get there.
We discussed that some time ago, and Mathias provided a Voodoo overload routine for "text(Column, Object)" which effectively ran the respective DXL in an eval_ call. I see if I find the respective routine.
Regards,
Peter
Side note: You are not deleting 'bufDiff'
|
|
Re: Dynamic Column compare jester76 - Tue Aug 28 10:55:34 EDT 2012 kbmurphy - Mon Aug 27 19:50:09 EDT 2012
You said:
>
> This script does not display anything. Can someone please let me know why? Regards Jester
The script doesn't have a line instructing it to display anything. (I assume this is layout DXL)
With Variable text passed to display function.
//Object ob = current
string Text=""
Buffer bufCur = create()
bufCur = plainText(text(column 1, obj))
Buffer bufOld = create()
Buffer bufDiff = create()
bufOld= plainText(text(column 2, obj))
if (bufCur!=bufOld)
{
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
Text = Text stringOf(bufDiff) " \n"
}
delete(bufOld)
delete(bufCur)
displayRich (Text)
delete(bufDiff)
|
|
Re: Dynamic Column compare Peter_Albert - Tue Aug 28 11:35:00 EDT 2012 jester76 - Tue Aug 28 10:55:34 EDT 2012
With Variable text passed to display function.
//Object ob = current
string Text=""
Buffer bufCur = create()
bufCur = plainText(text(column 1, obj))
Buffer bufOld = create()
Buffer bufDiff = create()
bufOld= plainText(text(column 2, obj))
if (bufCur!=bufOld)
{
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
Text = Text stringOf(bufDiff) " \n"
}
delete(bufOld)
delete(bufCur)
displayRich (Text)
delete(bufDiff)
We identified the underlying problem here. From Mathias' post I created the attached script, which overloads 'text(col,obj)'. With that, the following should work for you:
#include <../include/getColumnText.inc>
string Text=""
Buffer bufCur = create()
bufCur = text(column 1, obj) ""
Buffer bufOld = create()
bufOld= text(column 2, obj) ""
if (bufCur != bufOld)
{
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
displayRich tempStringOf(bufDiff)
delete bufDiff
}
delete(bufOld)
delete(bufCur)
You have to adjust the path in the include statement, of course.
Regards,
Peter
Attachments
attachment_14880248_getColumnText.inc
|
|
Re: Dynamic Column compare jester76 - Tue Aug 28 12:39:04 EDT 2012 Peter_Albert - Tue Aug 28 11:35:00 EDT 2012
We identified the underlying problem here. From Mathias' post I created the attached script, which overloads 'text(col,obj)'. With that, the following should work for you:
#include <../include/getColumnText.inc>
string Text=""
Buffer bufCur = create()
bufCur = text(column 1, obj) ""
Buffer bufOld = create()
bufOld= text(column 2, obj) ""
if (bufCur != bufOld)
{
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\cf1\\strike ", "\\cf3\\ul ")
displayRich tempStringOf(bufDiff)
delete bufDiff
}
delete(bufOld)
delete(bufCur)
You have to adjust the path in the include statement, of course.
Regards,
Peter
Peter,
Thank you very much for your help and effort.
It did work to some extent. I tried to get rid of richtext formatting but I was unable to do so. I tried casting it with richtext etc.
Any Idea how I can fix this?
Picture attached.
Regards
Attachments
attachment_14880275_Revision.png
|
|
Re: Dynamic Column compare jester76 - Tue Aug 28 13:20:31 EDT 2012 jester76 - Tue Aug 28 12:39:04 EDT 2012
Peter,
Thank you very much for your help and effort.
It did work to some extent. I tried to get rid of richtext formatting but I was unable to do so. I tried casting it with richtext etc.
Any Idea how I can fix this?
Picture attached.
Regards
Peter,
Never mind I got it working now. I used plainText at source and that did the trick. For example:
bufCur = plainText text(column 1, obj)
Thanks
Jester
|
|
Re: Dynamic Column compare jester76 - Mon Sep 24 17:07:31 EDT 2012 jester76 - Tue Aug 28 13:20:31 EDT 2012
Peter,
Never mind I got it working now. I used plainText at source and that did the trick. For example:
bufCur = plainText text(column 1, obj)
Thanks
Jester
Hello Having issues with the following code. It worked other day and now my testers are saying it does work. It keeps on refreshing half the screen and never ends. I and curious why the logging is happening 2 times.
Is there any other way of baseline comparison in readonly more.
This column compares col 1 and col2.
// =============================================================================
string textOrig(Column col, Object obj){string s = text(col, obj); return s}
// =============================================================================
Buffer gbColumnValue = create()
pragma runLim, 0
string prefCode;
string lineSep = "\n"
prefCode = "
Buffer bres = addr_ " ((addr_ gbColumnValue ) int) "\n
setempty bres
void displayRich (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (Attr__ x) {Buffer c = create(); c = x; if (length bres > 0){bres += \"" lineSep "\"}; bres += c; delete c;}
void displayRichWithColour (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void displayRichWithColor (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
"
string text(Column col, Object obj)
{
string returnValue = ""
gbColumnValue = ""
if (!main col && attrName col == "" )
{
Buffer code = create()
code += "Object obj = addr_ " ((addr_ obj) int) "\n"
code += "attrDXLName = \"" attrDXLName "\"\n"
code += prefCode; code += dxl col; code += "\n"
noError()
(current ModuleRef__) = module obj
eval_ tempStringOf code
string errMsg = lastError()
delete code
}
else if (attrName col != "")
{
gbColumnValue = probeAttr_ (obj, attrName col)
}
else if (main col)
{
Buffer oh = create()
oh = obj."Object Heading"
Buffer ot = create()
ot = obj."Object Text"
gbColumnValue = ""
gbColumnValue += oh
if (length gbColumnValue > 0){gbColumnValue += "\n"}
gbColumnValue += ot
delete oh
delete ot
}
return stringOf gbColumnValue
}
string Text=""
Buffer bufCur = create()
bufCur = plainText text(column 1, obj)
Buffer bufOld = create()
bufOld= plainText text(column 2, obj)
string strLog = "c:/temp/execution-log-col3.txt"
Stream strmLog = append strLog // create execution log file
if (bufCur != bufOld)
{
strmLog << identifier obj "\n"
logged in file 2wice
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\b\\cf3\\ul ", "\\b\\cf1\\strike ")
displayRichWithColor tempStringOf(bufDiff)
delete bufDiff
}
delete(bufOld)
delete(bufCur)
close strmLog
|
|
Re: Dynamic Column compare jester76 - Mon Sep 24 17:16:58 EDT 2012 jester76 - Mon Sep 24 17:07:31 EDT 2012
Hello Having issues with the following code. It worked other day and now my testers are saying it does work. It keeps on refreshing half the screen and never ends. I and curious why the logging is happening 2 times.
Is there any other way of baseline comparison in readonly more.
This column compares col 1 and col2.
// =============================================================================
string textOrig(Column col, Object obj){string s = text(col, obj); return s}
// =============================================================================
Buffer gbColumnValue = create()
pragma runLim, 0
string prefCode;
string lineSep = "\n"
prefCode = "
Buffer bres = addr_ " ((addr_ gbColumnValue ) int) "\n
setempty bres
void displayRich (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (Attr__ x) {Buffer c = create(); c = x; if (length bres > 0){bres += \"" lineSep "\"}; bres += c; delete c;}
void displayRichWithColour (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void displayRichWithColor (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
"
string text(Column col, Object obj)
{
string returnValue = ""
gbColumnValue = ""
if (!main col && attrName col == "" )
{
Buffer code = create()
code += "Object obj = addr_ " ((addr_ obj) int) "\n"
code += "attrDXLName = \"" attrDXLName "\"\n"
code += prefCode; code += dxl col; code += "\n"
noError()
(current ModuleRef__) = module obj
eval_ tempStringOf code
string errMsg = lastError()
delete code
}
else if (attrName col != "")
{
gbColumnValue = probeAttr_ (obj, attrName col)
}
else if (main col)
{
Buffer oh = create()
oh = obj."Object Heading"
Buffer ot = create()
ot = obj."Object Text"
gbColumnValue = ""
gbColumnValue += oh
if (length gbColumnValue > 0){gbColumnValue += "\n"}
gbColumnValue += ot
delete oh
delete ot
}
return stringOf gbColumnValue
}
string Text=""
Buffer bufCur = create()
bufCur = plainText text(column 1, obj)
Buffer bufOld = create()
bufOld= plainText text(column 2, obj)
string strLog = "c:/temp/execution-log-col3.txt"
Stream strmLog = append strLog // create execution log file
if (bufCur != bufOld)
{
strmLog << identifier obj "\n"
logged in file 2wice
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\b\\cf3\\ul ", "\\b\\cf1\\strike ")
displayRichWithColor tempStringOf(bufDiff)
delete bufDiff
}
delete(bufOld)
delete(bufCur)
close strmLog
To ad more context it looks like it only processes set of objects. and then loops back. Here is how I create the columns.
void loadRevisionView()
{
//delete all columns in existing view
current = sourceModule
int n = 0 // number of existing columns
int i // column index
Column c
for c in sourceModule do
n++ // count the columns
// delete n column 0s
for i in 1:n do {
delete column 0
}
insert column 0
attribute(column 0, "Absolute Number")
width(column 0,70)
justify(column 0, left)
insert column 1
//attribute(column 1,DATE1_ATTR)
string strPath1 = readFile strDataandDxlPath "col1.dxl"
strPath1 = "string filename = " "\"" strDate1 "\"" "\n" strPath1
dxl(column 1, strPath1)
width(column 1,350)
title(column 1, DATE1_ATTR)
justify(column 1,left)
insert column 2
//attribute(column 2,DATE2_ATTR)
string strPath2 = readFile strDataandDxlPath "col2.dxl"
strPath2 = "string filename = " "\"" strDate2 "\"" "\n" strPath2
dxl(column 2, strPath2)
width(column 2,350)
title(column 2, DATE2_ATTR)
justify(column 2,left)
insert column 3
//attribute(column 3,REVISION_ATTR)
string strPath3 = readFile strDataandDxlPath "col3.dxl"
//strPath3 = "string filename = " "\"" strRev "\"" "\n" strPath3
dxl(column 3, strPath3)
width(column 3,350)
title(column 3, REVISION_ATTR)
justify(column 3,left)
// Show deleted objects
refresh current
}
|
|
Re: Dynamic Column compare llandale - Thu Sep 27 11:21:16 EDT 2012 jester76 - Mon Sep 24 17:07:31 EDT 2012
Hello Having issues with the following code. It worked other day and now my testers are saying it does work. It keeps on refreshing half the screen and never ends. I and curious why the logging is happening 2 times.
Is there any other way of baseline comparison in readonly more.
This column compares col 1 and col2.
// =============================================================================
string textOrig(Column col, Object obj){string s = text(col, obj); return s}
// =============================================================================
Buffer gbColumnValue = create()
pragma runLim, 0
string prefCode;
string lineSep = "\n"
prefCode = "
Buffer bres = addr_ " ((addr_ gbColumnValue ) int) "\n
setempty bres
void displayRich (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void display (Attr__ x) {Buffer c = create(); c = x; if (length bres > 0){bres += \"" lineSep "\"}; bres += c; delete c;}
void displayRichWithColour (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
void displayRichWithColor (string x) {if (length bres > 0){bres += \"" lineSep "\"}; bres += x}
"
string text(Column col, Object obj)
{
string returnValue = ""
gbColumnValue = ""
if (!main col && attrName col == "" )
{
Buffer code = create()
code += "Object obj = addr_ " ((addr_ obj) int) "\n"
code += "attrDXLName = \"" attrDXLName "\"\n"
code += prefCode; code += dxl col; code += "\n"
noError()
(current ModuleRef__) = module obj
eval_ tempStringOf code
string errMsg = lastError()
delete code
}
else if (attrName col != "")
{
gbColumnValue = probeAttr_ (obj, attrName col)
}
else if (main col)
{
Buffer oh = create()
oh = obj."Object Heading"
Buffer ot = create()
ot = obj."Object Text"
gbColumnValue = ""
gbColumnValue += oh
if (length gbColumnValue > 0){gbColumnValue += "\n"}
gbColumnValue += ot
delete oh
delete ot
}
return stringOf gbColumnValue
}
string Text=""
Buffer bufCur = create()
bufCur = plainText text(column 1, obj)
Buffer bufOld = create()
bufOld= plainText text(column 2, obj)
string strLog = "c:/temp/execution-log-col3.txt"
Stream strmLog = append strLog // create execution log file
if (bufCur != bufOld)
{
strmLog << identifier obj "\n"
logged in file 2wice
Buffer bufDiff = create()
diff(bufDiff, bufOld, bufCur, "\\b\\cf3\\ul ", "\\b\\cf1\\strike ")
displayRichWithColor tempStringOf(bufDiff)
delete bufDiff
}
delete(bufOld)
delete(bufCur)
close strmLog
Without a doubt all permanant clever "column" DXL should be implemented as Attr-DXL. Layouts feature constant re-calculation and will consume computer and DOORS resources. Attr-DXL is executed only once when first viewed.
-Louie
|
|
Re: Dynamic Column compare Peter_Albert - Thu Sep 27 12:14:51 EDT 2012 llandale - Thu Sep 27 11:21:16 EDT 2012
Without a doubt all permanant clever "column" DXL should be implemented as Attr-DXL. Layouts feature constant re-calculation and will consume computer and DOORS resources. Attr-DXL is executed only once when first viewed.
-Louie
Louie is right regarding re-calculation and resources. But sometimes you lack exclusive edit to the Module, or you don't want to clutter the Module with attribute DXL. In those cases it can be handy to use yet another one of Mathis' Voodo tricks he posted here: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14891453. It features a layout DXL whose content is calculated only once (or on request) while the actual layout DXL code just fetches its value from an internal Skip list (memory passing voodoo applied here). I just gave it a try on a baseline comparison script which I normally use in layout DXL, with the known limitations (slow scrolling, slow filtering, general slowdown of everything). With Mathias' approach, the tool needs some time to warm-up (when it is executed for all Objects once), but user interaction afterwards is lightning fast. So it has the performance of an attribute DXL (ok, I think attribute DXL is only executed when the actual object is visible, so it starts quicker) with the advantages (user access limitations wise) of layout DXL. And it is quite flexible. Mathias' example is quite general, and I guess it can be easily adapted to the code in this topic.
Regards,
Peter
|
|
Re: Dynamic Column compare Mathias Mamsch - Thu Sep 27 14:41:23 EDT 2012 Peter_Albert - Thu Sep 27 12:14:51 EDT 2012
Louie is right regarding re-calculation and resources. But sometimes you lack exclusive edit to the Module, or you don't want to clutter the Module with attribute DXL. In those cases it can be handy to use yet another one of Mathis' Voodo tricks he posted here: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14891453. It features a layout DXL whose content is calculated only once (or on request) while the actual layout DXL code just fetches its value from an internal Skip list (memory passing voodoo applied here). I just gave it a try on a baseline comparison script which I normally use in layout DXL, with the known limitations (slow scrolling, slow filtering, general slowdown of everything). With Mathias' approach, the tool needs some time to warm-up (when it is executed for all Objects once), but user interaction afterwards is lightning fast. So it has the performance of an attribute DXL (ok, I think attribute DXL is only executed when the actual object is visible, so it starts quicker) with the advantages (user access limitations wise) of layout DXL. And it is quite flexible. Mathias' example is quite general, and I guess it can be easily adapted to the code in this topic.
Regards,
Peter
And now take the timer approach from this post:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14850573�
to calculate the comparison in the background instead of calculating it all at once and show the progress in the dialog. Then the user can immediately start roaming around in the module, without any wait times. Looks very professional ;-)
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Dynamic Column compare Peter_Albert - Fri Sep 28 08:34:00 EDT 2012 Mathias Mamsch - Thu Sep 27 14:41:23 EDT 2012
And now take the timer approach from this post:
https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14850573�
to calculate the comparison in the background instead of calculating it all at once and show the progress in the dialog. Then the user can immediately start roaming around in the module, without any wait times. Looks very professional ;-)
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Hi Mathias,
thanks again! That works really nicely! One last thing to improve the user experience: I want to refresh the Module when the Objects currently visible on the screen have been processed. Do you know if there is an equivalent to the 'isFirstObjectInDXLSet' / 'isLastObjectInDXLSet' perms which work in layout DXL? 'isVisible Object' does not help, as it reports the display state, but not if the actual Object is in the part of the Module window which is currently visible to the user.
Regards,
Peter
|
|
Re: Dynamic Column compare Mathias Mamsch - Fri Sep 28 11:06:19 EDT 2012 Peter_Albert - Fri Sep 28 08:34:00 EDT 2012
Hi Mathias,
thanks again! That works really nicely! One last thing to improve the user experience: I want to refresh the Module when the Objects currently visible on the screen have been processed. Do you know if there is an equivalent to the 'isFirstObjectInDXLSet' / 'isLastObjectInDXLSet' perms which work in layout DXL? 'isVisible Object' does not help, as it reports the display state, but not if the actual Object is in the part of the Module window which is currently visible to the user.
Regards,
Peter
Hmm ... From my experince since the objects will be refreshed as soon as the user clicks a button or changes selection or does anything I think its not too bad as it is. What you could try is continuously put the absolute Numbers of firstObjectInDXLSet and lastObjectInDXLSet with keys -1 and -2 to the skip from the DXL Layout. As long as you only write integers, you probably will not get any crash problems.
Then the GUI could check, if it has been calculating of of those objects and then issue a refresh. For this whenever it calculated a result, it could check the indexes -1 and -2 in the skip list and compare it to the absolute number of the calculated comparison. Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Dynamic Column compare Peter_Albert - Mon Oct 01 03:56:31 EDT 2012 Mathias Mamsch - Fri Sep 28 11:06:19 EDT 2012
Hmm ... From my experince since the objects will be refreshed as soon as the user clicks a button or changes selection or does anything I think its not too bad as it is. What you could try is continuously put the absolute Numbers of firstObjectInDXLSet and lastObjectInDXLSet with keys -1 and -2 to the skip from the DXL Layout. As long as you only write integers, you probably will not get any crash problems.
Then the GUI could check, if it has been calculating of of those objects and then issue a refresh. For this whenever it calculated a result, it could check the indexes -1 and -2 in the skip list and compare it to the absolute number of the calculated comparison. Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Yes, it refreshes when the user clicks somewhere, but he has to know when it is a good timw to do so ... Anyway, your idea works perfectly, just putting lastObjectInDXLSet to the Skip list at -1 and checking at the actual object calculation does the refresh just at the right time.
Thanks again,
Peter
|
|
Re: Dynamic Column compare llandale - Mon Oct 01 13:29:07 EDT 2012 Peter_Albert - Thu Sep 27 12:14:51 EDT 2012
Louie is right regarding re-calculation and resources. But sometimes you lack exclusive edit to the Module, or you don't want to clutter the Module with attribute DXL. In those cases it can be handy to use yet another one of Mathis' Voodo tricks he posted here: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14891453. It features a layout DXL whose content is calculated only once (or on request) while the actual layout DXL code just fetches its value from an internal Skip list (memory passing voodoo applied here). I just gave it a try on a baseline comparison script which I normally use in layout DXL, with the known limitations (slow scrolling, slow filtering, general slowdown of everything). With Mathias' approach, the tool needs some time to warm-up (when it is executed for all Objects once), but user interaction afterwards is lightning fast. So it has the performance of an attribute DXL (ok, I think attribute DXL is only executed when the actual object is visible, so it starts quicker) with the advantages (user access limitations wise) of layout DXL. And it is quite flexible. Mathias' example is quite general, and I guess it can be easily adapted to the code in this topic.
Regards,
Peter
I don't think it wise to recommend "Voodoo" to folks not that familiar with DXL. I do a great deal of "complicated" stuff and have not ever had to resort to "Voodoo".
-Louie
Not that I'm afraid or ignorant or superstitious or anything like that... ;)
|
|
Re: Dynamic Column compare Peter_Albert - Tue Oct 02 05:49:33 EDT 2012 llandale - Mon Oct 01 13:29:07 EDT 2012
I don't think it wise to recommend "Voodoo" to folks not that familiar with DXL. I do a great deal of "complicated" stuff and have not ever had to resort to "Voodoo".
-Louie
Not that I'm afraid or ignorant or superstitious or anything like that... ;)
To be honest, I call everything Voodoo which uses 'addr_' in one way or the other. Call it anxiety, ignorance, or superstition :-)
More seriously, I always have a slightly bad gut feeling when using undocumented DXL, for the possibility that it vanishes silently in the future.
But you are right, recommending this in that thread was possibly no good advice.
Regards,
Peter
|
|
Re: Dynamic Column compare Mathias Mamsch - Tue Oct 02 15:53:26 EDT 2012 Peter_Albert - Tue Oct 02 05:49:33 EDT 2012
To be honest, I call everything Voodoo which uses 'addr_' in one way or the other. Call it anxiety, ignorance, or superstition :-)
More seriously, I always have a slightly bad gut feeling when using undocumented DXL, for the possibility that it vanishes silently in the future.
But you are right, recommending this in that thread was possibly no good advice.
Regards,
Peter
I think you guys should state the questions that are behind your comments, explicitly, instead of dancing around the cake.
1. Vodoo, addr_ and other bad things - is it save?
In my opinion this is not about documented and undocumented DXL. If we would care about if someone documented DXL there is a lot of DXL that we would not use until Telelogic/Rational/IBM cared to document it. We are all looking at the different perms lists for exactly the reasons that a lot of DXL is undocumented. I think the main issue is being dependent on DOORS internals (that theoretically could change without DXL changing). I post a lot of code that is more or less dependent on DOORS internals. Take the string table or the memory leak detection code I posted some time ago. The code is highly dependend on DOORS internals. Since that code is for development purposes only, meaning you will use it while developing DXL without memory leaks and string table littering without ever using it in productive DXL, the question of being dependend on DOORS internals is completely out of the way. The DXL layout code does not have an important dependency to DOORS internals. It relies on the fact how built-in types like Skips can be seen as references. If built in types were no references anymore, then you could not put a Skip in a Skip and assignments of Skip a = b would not work the same anymore. So I would consider that code really save in comparison to other code I posted. We also do not need to fear addr_ to disappear. In fact you can put a Buffer in a Skip and read it back to an integer. That is just the same that we do with addr_ (type cast). So this is also not a real threat. When we talk about the safety of the cached layout code I guess the question of what happens when the user stores the column in a view is much more interesting than the fact of using addr_ in the code.
2. Is it really necessary?
"Keep it simple" is always appropriate. If some code is just complicated and fancy and can be replaced with easier code with the same functionality then there is no arguing of that code being useless. However most of the 'bad' stuff I post simply cannot be achieved in any other way. You cannot have background calculation without a timer. You cannot add a responsive DXL column that needs heavy calculation without having a DXL attribute. When you cannot have a DXL attribute you are out of luck. Do you need it? Well I guess everyone must decide this for himself. In fact you do might not need comparison columns at all. Write the stuff to a file. This question cannot serve as a base for recommending code or not.
3. Does it work reliably?
I guess this is a general question for all code. If it does not work one needs to fix it. I would consider it a good practice to test code that someone posts in the forum and report back positive or negative feedback. So at least I appreciate Peter for trying the code and reporting if it works or not.
So summing up, I do not think it is usefull to use labels like 'Vodoo' - instead we should discuss, how safe code is and take a look at the situations where a certain code is appropriate and where it is not appropriate. And I do not think it is wise to recommend not recommending code with fuzzy reasons. Bring the problems to the point discuss them, but don't just silence people.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
|
Re: Dynamic Column compare llandale - Fri Oct 05 13:41:58 EDT 2012 Mathias Mamsch - Tue Oct 02 15:53:26 EDT 2012
I think you guys should state the questions that are behind your comments, explicitly, instead of dancing around the cake.
1. Vodoo, addr_ and other bad things - is it save?
In my opinion this is not about documented and undocumented DXL. If we would care about if someone documented DXL there is a lot of DXL that we would not use until Telelogic/Rational/IBM cared to document it. We are all looking at the different perms lists for exactly the reasons that a lot of DXL is undocumented. I think the main issue is being dependent on DOORS internals (that theoretically could change without DXL changing). I post a lot of code that is more or less dependent on DOORS internals. Take the string table or the memory leak detection code I posted some time ago. The code is highly dependend on DOORS internals. Since that code is for development purposes only, meaning you will use it while developing DXL without memory leaks and string table littering without ever using it in productive DXL, the question of being dependend on DOORS internals is completely out of the way. The DXL layout code does not have an important dependency to DOORS internals. It relies on the fact how built-in types like Skips can be seen as references. If built in types were no references anymore, then you could not put a Skip in a Skip and assignments of Skip a = b would not work the same anymore. So I would consider that code really save in comparison to other code I posted. We also do not need to fear addr_ to disappear. In fact you can put a Buffer in a Skip and read it back to an integer. That is just the same that we do with addr_ (type cast). So this is also not a real threat. When we talk about the safety of the cached layout code I guess the question of what happens when the user stores the column in a view is much more interesting than the fact of using addr_ in the code.
2. Is it really necessary?
"Keep it simple" is always appropriate. If some code is just complicated and fancy and can be replaced with easier code with the same functionality then there is no arguing of that code being useless. However most of the 'bad' stuff I post simply cannot be achieved in any other way. You cannot have background calculation without a timer. You cannot add a responsive DXL column that needs heavy calculation without having a DXL attribute. When you cannot have a DXL attribute you are out of luck. Do you need it? Well I guess everyone must decide this for himself. In fact you do might not need comparison columns at all. Write the stuff to a file. This question cannot serve as a base for recommending code or not.
3. Does it work reliably?
I guess this is a general question for all code. If it does not work one needs to fix it. I would consider it a good practice to test code that someone posts in the forum and report back positive or negative feedback. So at least I appreciate Peter for trying the code and reporting if it works or not.
So summing up, I do not think it is usefull to use labels like 'Vodoo' - instead we should discuss, how safe code is and take a look at the situations where a certain code is appropriate and where it is not appropriate. And I do not think it is wise to recommend not recommending code with fuzzy reasons. Bring the problems to the point discuss them, but don't just silence people.
Regards, Mathias
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
What you do may be "ordinary" to you, but you seem to forget it is "extrordinary" to the vast majority of folks.
-
"Magic": Technology you don't understand.
-
"Voodoo": "Magic" you fear.
Ancient Wizards didn't think of it as "magic", just manipulating the world using proven technology based on known and predicable laws of physics. Ancient Wizards would often do things other folks feared. Just because those ancient Wizards didn't think they were delving in Voodoo doesn't mean it isn't Voodoo to the rest of the folks.
Your points below are well taken:
1. Safe?
-
Probably, but needs to be verified by some other neutral Wizard.
2. Necessary?
-
KEY POINT. Only do it this way when it is necessary
3. Reliable?
I think you need to add points 4 and 5:
4. Does it violate the natural laws of the universe ..err.. the language?
5. Is it understandable and maintainable?
There is no question that using addr_ et tal to turn Skip lists into linked lists for easy parsing and manipulating is "Magic". There is no question that monkeying around inside these data types and internals is "fearful" to the vast majority of us, including me.
-Louie
"Voodoo", BTW, has an element of "admiration" to it. Peasants didn't just fear the Wizards, they also admired them.
|
|